package com.xingchi.tornado.storage.core.jackson;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * json实现字段转文件
 *
 * @author xingchi
 * @date 2025/4/20 23:14
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = JsonFileUrlSerializer.class)
public @interface JsonFileUrl {

    /**
     * 文件后缀
     *
     * @return  文件后缀
     */
    @AliasFor("value")
    String suffix() default "Url";

    @AliasFor("suffix")
    String value() default "Url";

}
